import { request } from "@umijs/max";


export const addApi = (data: any) => {
  return request('/banner/add', {
    method: 'POST',
    data: data,
  });
}

export const selectListApi = (data: any) => {
  return request<any>('/banner/selectList', {
    method: 'POST',
    data: data,
  });
}

export const deleteApi = (id: number) => {
  return request<any>('/banner/delete', {
    method: 'POST',
    data: {
      ids:[id]
    },
  });
}
export const updateApi = (data: any) => {
  return request('/banner/update', {
    method: 'POST',
    data: data,
  });
}

export const sortApi = (data: any[]) => {
  return request('/banner/sort', {
    method: 'POST',
    data: {list:data},
  });
}

export const selectOneApi = (id: any) => {
  return request('/banner/selectOne', {
    method: 'POST',
    data: { id },
  });
}